home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oh!X 2000 Spring
/
Oh!X 2000 Spring Special CD-ROM (Japan) (Part 1).7z
/
Oh!X 2000 Spring Special CD-ROM (Japan) (Part 1).bin
/
X68CD
/
CDDUMP.C
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-30
|
1KB
|
65 lines
/* CDDUMP
*/
#include <stdio.h>
#include <iocslib.h>
int main(argc,argv)
int argc;
char *argv[];
{
int pos, pos_st=0, pos_et, len=327680;
int block=1, id=6, size=4; //size:1=512byte/sec,4=2048byte/sec
int ac,x,y,ibuf;
unsigned char buf[2048];
for( ac=1; ac<argc; ac++ ){;if( argv[ac][0]=='/' || argv[ac][0]=='-' ){
switch( argv[ac][1] ){
case 'i': case 'I':
sscanf(&argv[ac][2],"%d",&id);
break;
case '$': case 'X':
sscanf(&argv[ac][2],"%x,%x",&pos_st,&len);
break;
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': case '0':
sscanf(&argv[ac][1],"%d,%d",&pos_st,&len);
break;
default:
printf("X68k CD-Dump v0.00 \n"
"使用法::cddump [/In] [/ブロック,長さ]\n\n"
"\tアドレス指定、長さ指定は先頭に X か $ を付けると\n"
"\t16進数になります\n"
"\t/In:nにはCD-ROMのSCSI-IDを設定します(デフォルト=6)\n"
);
goto quick_exit;
break;
}
}}
pos_et=pos_st+len-1;
for( pos=pos_st; pos<=pos_et; pos++ ){
S_READ(pos,block,id,size,buf);
for( y=0;y<128;y++ ){
for( x=0;x<16;x++ ){
printf("%02x ",buf[y*16+x]);
}
for( x=0;x<16;x++ ){
printf("%c",(buf[y*16+x]<=0x1f)?'.':buf[y*16+x]);
}
ibuf=(int)buf[y*16+x];
if( (0x80<=ibuf && ibuf<=0x9F) || (0xE0<=ibuf && ibuf<=0xFF) ){
printf("%c",'\x40');
}
printf("\n");
}
}
quick_exit:
return(0);
}
/* [ EOF ] */